package cn.neusoft.luofa603.yuejian.Adapter;

import android.content.Context;
import android.databinding.ViewDataBinding;

import java.util.List;

/**
 * Created by P.Block on 2017/09/27.
 */

public class SimpleDBAdapter<M,B extends ViewDataBinding> extends DataBindingRecyclerAdapter<M,B> {
    private int layoutId;
    private int variableId;

    public SimpleDBAdapter(Context context, int layoutId, int variableId, List<M> data) {
        super(context,data);
        this.layoutId = layoutId;
        this.variableId = variableId;
    }

    @Override
    protected int getLayoutResId() {
        return layoutId;
    }

    @Override
    protected void onBindItem(B binding, M item) {
        binding.setVariable(variableId,item);
    }

}
